﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

using ERPStore.Extensions;

using Microsoft.Practices.Unity;

namespace ERPStore.Web.NewsLetters
{
	public abstract class NewsLetterWebPage : WebViewPage
	{
		protected Microsoft.Practices.Unity.IUnityContainer m_Container;

		public NewsLetterWebPage()
		{
			m_Container = ERPStore.GlobalConfiguration.Configuration.DependencyResolver.GetContainer();
		}

		public Html.NewsLetterHelper NL { get; private set; }

		public override void InitHelpers()
		{
			base.InitHelpers();
			NL = new Html.NewsLetterHelper(this.ViewContext, this);
			m_Container.BuildUp(NL);
		}
	}

	public abstract class NewsLetterWebPage<TModel> : WebViewPage<TModel>
	{
		protected Microsoft.Practices.Unity.IUnityContainer m_Container;

		public NewsLetterWebPage()
		{
			m_Container = ERPStore.GlobalConfiguration.Configuration.DependencyResolver.GetContainer();
		}

		public Html.NewsLetterHelper<TModel> NL { get; private set; }

		public override void InitHelpers()
		{
			base.InitHelpers();
			NL = new Html.NewsLetterHelper<TModel>(this.ViewContext, this);
			m_Container.BuildUp(NL);
		}
	}

}
